import service from "@/utils/service.js";

// 学生首页
export const getHomeInfo = () => {
	return service({
		method: "GET",
		url: "/api/student/home",
	});
};
// 获取电费订单
export const getOrder = (id) => {
	return service({
		method: "GET",
		url: "/api/student/paylist",
        params:{id:id}
	});
};
// 获取学生ID
export const getCardId = (id) => {
	return service({
		method: "GET",
		url: "/api/student/getCardId",
        params:{id:id}
	});
};
// 获取房间电费
export const getDian = (id) => {
	return service({
		method: "GET",
		url: "/api/student/getDian",
        params:{id:id}
	});
};
// 获取楼栋id
export const getBuildId = (name) => {
	return service({
		method: "GET",
		url: "/api/student/getBuildId",
        params:name
	});
};
// 获取楼层房间信息
export const getRoom = ({...info}) => {
	return service({
		method: "GET",
		url: "/api/student/getRoom",
        params:info
	});
};
//更新房间信息
export const StudenUpdateRoom = ({...info}) => {
	return service({
		method: "POST",
		url: "/api/student/UpdataRoom",
        params:info
	});
};
// 充电费
export const StudenPayFees = ({...info}) => {
	return service({
		method: "POST",
		url: "/api/student/PayFees",
        params:info
	});
};
// 更新电费
export const UpdatePayFees = (num) => {
	return service({
		method: "POST",
		url: "/api/student/UpdatePayFees",
        params:num
	});
};
// 获取房间电费
export const DianInfo = (id) => {
	return service({
		method: "get",
		url: "/api/student/DianInfo",
        params:id
	});
};
// 获取校园卡信息
export const shcoolCost = (id) => {
	return service({
		method: "get",
		url: "/api/student/shcoolCost",
        params:id
	});
};
// 充校园卡
export const UpdateSchool = ({...info}) => {
	return service({
		method: "post",
		url: "/api/student/UpdateSchool",
        params:info
	});
};
// 获取当前登录账户的所有信息
// 导出
export const LoginInfo = (id) => {
	return service({
		method: "get",
		url: "/api/student/LoginInfo",
        params:{...id}
	});
};
// 插入报修数据
export const InsetBao = ({...info}) => {
	return service({
		method: "post",
		url: "/api/student/InsetBao",
        params:info
	});
};
// 更新用户信息
export const updateInfo = ({...info}) => {
	return service({
		method: "post",
		url: "/api/student/updateLoginInfo",
        params:info
	});
};
// 公告详情
export const getTitleInfo = (id) => {
	return service({
		method: "get",
		url: "/api/student/getTitleInfo",
        params:id
	});
};
// 更新水费
export const UpdateWater = (info) => {
	return service({
		method: "post",
		url: "/api/student/UpdateWater",
        params:{...info}
	});
};
// 删除充值记录
export const clearOrder = (id) => {
	debugger
	return service({
		method: "delete",
		url: "/api/student/clearOrder",
        data:{id:id}
	});
};
// 获取消费记录
export const OrderCost = (id) => {
	// debugger
	return service({
		method: "get",
		url: "/api/student/OrderCost",
        params:{id:id}
	});
};
// 插入房间
export const insertRoom = (info) => {
	// debugger
	return service({
		method: "post",
		url: "/api/student/insertRoom",
        params:{...info}
	});
};
// 获取电费
export const getDians = (id) => {
	// debugger
	return service({
		method: "get",
		url: "/api/student/getDians",
        params:{id:id}
	});
};